/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pin.db.devel;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import pin.db.dbcp.Dbcp;

/**
 *
 * @author huxiaodi
 */
public class Java2String {

    public static void main(String[] args) throws FileNotFoundException, IOException {
        String javaFilePath = "src/pin/db/devel/sql";

        String classesPath = Dbcp.class.getClassLoader().getResource(".").toString();//.getResourceAsStream(javaFile);
        //FileReader fr=new FileReader(javaFile)
        System.out.println(classesPath + "../../" + javaFilePath);
        File javaFile = new File((classesPath + "../../" + javaFilePath).substring(5));

        System.out.println(javaFile.exists());
        FileReader fr = new FileReader(javaFile);
        BufferedReader br = new BufferedReader(fr);
        String line;
        while ((line = br.readLine()) != null) {
            line = line.replaceAll("\"", "\\\\\"");
            if (!line.isEmpty()) {
                System.out.println("\"" + line + "  \" + ");
            }


        }

    }
}
